<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */

/**
 * Model for the shift roles
 * 
 * @category 	RedCross
 * @package	 	Core_Model
 */
class Core_Model_ShiftRole extends RedCross_Gateway_Base_ShiftRole
{
	const STATE_NOTIFICATION_NOT_RECEIVED = 1;
	const STATE_NOTIFICATION_RECEIVED = 2;
	const STATE_NOTIFICATION_CONFIRMED = 3;

	public function getState()
	{
		if (is_null($this->notification_sent_time))
		{
			return self::STATE_NOTIFICATION_NOT_RECEIVED;
		} else
		{
			if (is_null($this->notification_confirmed_time))
			{
				return self::STATE_NOTIFICATION_RECEIVED;
			} else
			{
				return self::STATE_NOTIFICATION_CONFIRMED;
			}
		}
	}
}